package au.edu.qut.bpm.genbinder.genetic.other;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.uncommons.watchmaker.framework.EvolutionaryOperator;

import au.edu.qut.bpm.genbinder.genetic.genesis.LogRepairFactory;
import au.edu.qut.bpm.genbinder.models.ConcreteEventLog;

public class LogRepairer implements EvolutionaryOperator<ConcreteEventLog> {

	public LogRepairer() { }

	public List<ConcreteEventLog> apply(List<ConcreteEventLog> selectedCandidates, Random rng) {
		List<ConcreteEventLog> fixed = new ArrayList<ConcreteEventLog>(selectedCandidates.size());
		//final LogRepairerSingleLog repair = new LogRepairerSingleLog();

		for (ConcreteEventLog log : selectedCandidates) {
			LogRepairFactory factory = new LogRepairFactory(log);
			ConcreteEventLog newReturnedLog = factory.generateRandomCandidate();
			fixed.add(newReturnedLog);
		}
		//fixed.add(repair.RepairOneLog(log));
		
		return fixed;
	}
}
